
	function showHideLoginForm()
	{
		var div = document.getElementById('login_form_div');
		
		if (div.style.display == 'none') div.style.display = 'block';
		else if (div.style.display == 'block') div.style.display = 'none';
	}
	
	function showHint(id)
	{
		var div = document.getElementById(id+'_hint');
		
		if (div.style.display == 'none')
		{
			div.style.display = 'block';
		}
		else if (div.style.display == 'block') div.style.display = 'none';
	}
	
	function showPopupHint(key)
	{
		var hint_div = document.getElementById('popup_hint_div');
		var hint_content_div = document.getElementById('hint_content_div');
		if (hint_div.style.display == 'none')
		{
			if (hints[key] != null)
			{
				hint_div.style.top = mouseY+10+'px';
				hint_div.style.left = mouseX+10+'px';
				hint_content_div.innerHTML = hints[key];
				hint_div.style.display = 'block';
			}
		}
		else if (hint_div.style.display == 'block')
		{
			hint_div.style.display = 'none';
		}
	}
	
	
	function toogle(id)
	{
		var el = document.getElementById(id);
		
		if (el.style.display == 'none') el.style.display = 'block';
		else if (el.style.display == 'block') el.style.display = 'none';
	}

function printWindow(location)
{
	window.open(location ,"mywindow","menubar=0,resizable=1,scrollbars=1,width=950,height=650");
}

// Открытие дива для отправки ссылки
function openMailForm()
{
	var mail_div = document.getElementById('mail_link_div');
	mail_div.style.top = screen_height / 2 + document.getElementById("cHTML").scrollTop - 150 + 'px';
	mail_div.style.left = screen_width / 2 + document.getElementById("cHTML").scrollLeft / 2 - 100 + 'px';
	toogle('mail_link_div');
//	alert(mail_div.style.top)
}

// Определение разрешения монитора
var screen_width = 0, screen_height = 0; 
function findDimensions()
{
  	if(window.innerWidth)
	{ 
	    screen_width = window.innerWidth; 
	    screen_height = window.innerHeight; 
	} 
	else if(document.documentElement && document.documentElement.clientWidth)
	{ 
	    screen_width = document.documentElement.clientWidth; 
	    screen_height = document.documentElement.clientHeight; 
	} 
	else if(document.body && document.body.clientWidth)
	{ 
	    screen_width = document.body.clientWidth; 
	    screen_height = document.body.clientHeight; screen.width
	} 
	else if(IE)
	{ 
	    screen_width = screen.width; 
	    screen_height = document.body.clientHeight; screen.width
	}
} 
findDimensions();

// Определение позиции курсора мыши
if (navigator.appName.indexOf("Microsoft Internet Explorer") != -1) IE = true;
else IE = false;

function getMouseXY(e) 
{
	if (IE) 
	{
		tempX = event.clientX + document.getElementById("cHTML").scrollLeft;
		tempY = event.clientY + document.getElementById("cHTML").scrollTop;
	} 
	else
	{
		tempX = e.pageX;
		tempY = e.pageY;
	}
	if (tempX < 0){tempX = 0}
	if (tempY < 0){tempY = 0}
	l = tempX;
	t = tempY;
	return true;
}

function openWindow(location, width, height)
{
	window.open(location ,"mywindow","menubar=0,resizable=1,scrollbars=1,width="+width+",height="+height);
}